var evaluate_orderId;
function setscore(score){
    $("#score").val(score);

    if(score<1||score>5)
        return;
    for(var i=1;i<6;i++){
        $("#s"+i).attr("src","img/teacher/star1@l.png");
    }
    for(var i=1;i<=score;i++){
        $("#s"+i).attr("src","img/teacher/star@l.png");
    }
};
//提交
function btnSubmit(param){
    if(param == "submit"){

        var formdata = $("#evaluate_frm_main").serializeObject();
        // console.log('submit member info:')
        // console.log(formdata);

        if(server.isEmpty(formdata.score)){
            pop_up("请打分");
            return;
        }
        if(server.isEmpty(formdata.content)||formdata.content.length<10){
            pop_up("至少写10个字的评价");
            return;
        }
        var orderId=evaluate_orderId;
        formdata.orderId=orderId;
        if(server.isEmpty(orderId)){
            pop_up("订单编号错误");
            return;
        }

    server.req('wechat/orderevaluate/evaluate',formdata,function (res) {
        // console.log(res);
        if(res.code==0){
            pop_up('感谢评价!');
            server.loadindex('page/order/orderlist/orderlist');
        }
    },null,'POST');

    }else if(param == "cancel"){
        server.loadindex('page/order/orderlist/orderlist');
    }
};

//从参数获取OrderID
evaluate_orderId = server.getQueryString("orderId")